<?php

/**
 * @author Tan-Tan
 * @package SeoPortal
 * @subpackage Server
 */
class CreateReportActivity extends Ezer_SynchronousActivity
{
	public function execute(array $args)
	{
		$this->log("Executing Create Report Activity");
		
		$siteId = $args[CaseManager::VAR_SITE_ID];
		
		$report = new SeoReport();
		$report->setSiteId($siteId);
		$report->save();
		
		$reportVar = new Ezer_AssignStepToAttribute(CaseManager::VAR_REPORT_ID);
		$this->addVariable($reportVar, $report->getId());
		
		$this->log("New report[" . $report->getId() . "] created");
		
		return true;
	}
}
